# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jnetmap
pkgver=0.5.5
pkgrel=1
groups=('blackarch' 'blackarch-networking')
pkgdesc='A network monitor of sorts.'
arch=('any')
url='https://sourceforge.net/projects/jnetmap/files/jNetMap%200.5.5-RC2/'
license=('GPL3')
depends=('java-environment')
source=("$pkgname-$pkgver.jar::https://downloads.sourceforge.net/project/$pkgname/jNetMap%20$pkgver-RC2/jNetMap-$pkgver-703.jar")
sha512sums=('d626d802bebeea0982826272195d0b14dfaa1d3272ffd128e529cd5efb1d14fa754816a4067090aa1a694e9956af0ddf9c3dc7fce1ea841aec5fbe8832ca44be')
noextract=("$pkgname-$pkgver.jar")

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname-$pkgver.jar" \
    "$pkgdir/usr/share/$pkgname/$pkgname-$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

